package com.job.DQH.dqh714.inClass;

import java.io.IOException;

//runtime类是单例类，只能调用其getruntime方法才能创建唯一的对象。
public class UseRuntime {
    public static void main(String[] args) throws IOException {
        Runtime runtime = Runtime.getRuntime();
        System.out.println(runtime.availableProcessors());
        System.out.println(runtime.maxMemory()/1024/1024+"MB");
        System.out.println(runtime.totalMemory()/1024/1024+"MB");
        System.out.println(runtime.freeMemory()/1024/1024+"MB");
        runtime.exec("mspaint");//开启“画图”软件
        runtime.exec("calc");//开启计算器软件
        runtime.exec("mstsc");//开启远程桌面控制
        runtime.exec("C:\\Program Files (x86)\\Tencent\\QQ\\Bin\\QQScLauncher.exe");//开启qq
    }
}
